package com.mywork.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mywork.dao.CurelistMapper;
import com.mywork.po.Curelist;
import com.mywork.po.Page;

@Service
public class CureListService {
	@Autowired
	CurelistMapper cureListDao;
	
	public void addCure(Curelist cureList){
		cureListDao.insertSelective(cureList);
	}

	
	
	
	public List<Curelist> getCureLists(Page page) {
		// TODO 自动生成的方法存根
		return cureListDao.selectForPage(page.getPageSize()*page.getPageNo(),page.getPageSize());
		
	}

	public void delectCure(String cureId) {
		// TODO 自动生成的方法存根
		cureListDao.deleteByPrimaryKey(Integer.valueOf(cureId).intValue());
	}
	
	public void updateCure(Curelist cureList){
		cureListDao.updateByPrimaryKeySelective(cureList);
	}




	public int getCountOfCureList() {
		// TODO 自动生成的方法存根
		return cureListDao.getCountOfCureList();
	}




	public Curelist getCureListByCureListId(String curelistId) {
		// TODO 自动生成的方法存根
		return cureListDao.selectByPrimaryKey(Integer.valueOf(curelistId));
	}




	public List<Curelist> getCureListByLevel(int i) {
		// TODO 自动生成的方法存根
		return cureListDao.selectAllByLevel(i+"");
	}




	public List<Curelist> getCureListByLastCureId(String lastCureId) {
		// TODO 自动生成的方法存根
		return cureListDao.selectAllByLastCureId(lastCureId);
	}
}
